////////////////////////////////////////////////////////////////////////////////
#ifndef _ORTHOWINDOWCLASS_H_
#define _ORTHOWINDOWCLASS_H_


#include <d3d11.h>
#include <d3dx10math.h>
#include "material.h"

class OrthoWindowClass
{
private:
	struct VertexType
	{
		D3DXVECTOR3 position;
	    D3DXVECTOR2 texture;
	};

public:
	OrthoWindowClass();

	bool Initialize(ID3D11Device*, int, int);
	void Shutdown();
	void Render(ID3D11DeviceContext*);

	int GetIndexCount();

	void SetMaterial(Material* const i_material)
	{
		m_material = i_material;
	}

	const Material* GetMaterial()
	{
		return m_material;
	}

	void SetPosition(float pos_x , float pos_y , float pos_z )
	{
		D3DXMATRIX trasl;
		m_pos[0]=pos_x;
		m_pos[1]=pos_y;
		m_pos[2]=pos_z;

		D3DXMatrixIdentity(&trasl);
		D3DXMatrixTranslation(&trasl,pos_x, pos_y, pos_z);
		D3DXMatrixMultiply(&m_transformation, &m_transformation, &trasl);
	};

private:
	bool InitializeBuffers(ID3D11Device*, int, int);
	void ShutdownBuffers();
	void RenderBuffers(ID3D11DeviceContext*);

private:
	ID3D11Buffer *m_vertexBuffer, *m_indexBuffer;
	int m_vertexCount, m_indexCount;
	float			m_pos[3];
	float			m_rotation[3];
	D3DXMATRIX		m_transformation;
	Material*		m_material;
	
};

#endif